home *** CD-ROM | disk | FTP | other *** search
/ Assassins - Ultimate CD Games Collection 3 / Assassins 3 - The Ultimate Games CD (1997)(Weird Science)[!][Amiga-CD32-CDTV].iso / extra_memory_needed / xconq / custom.ms < prev    next >
Text File  |  1995-03-06  |  16KB  |  399 lines

  1. .TL
  2. CUSTOMIZING XCONQ (Made Somewhat Simple)
  3. .AU
  4. Stan Shebs
  5. .AI
  6. Department of Computer Science
  7. University of Utah
  8. .AB
  9. For advanced players who desire new challenges, \fIxconq\fP provides several
  10. customization mechanisms.
  11. It is possible to build new maps, scenarios, and historical periods.
  12. This document describes the customization process in excruciating detail.
  13. The reader is assumed to be familiar with \fIxconq\fP and its basic
  14. documentation.
  15. .AE
  16. .SH
  17. INTRODUCTION
  18. .LP
  19. \fIXconq\fP has been designed to facilitate the construction of new maps,
  20. scenarios, and historical periods.
  21. All these additions happen through a single mechanism, the \fImapfile\fP,
  22. which comes in several parts, and may also load other mapfiles.
  23. Saved games are very detailed mapfiles; less detailed mapfiles are more
  24. suitable as scenarios.  Maps and period descriptions are mapfiles with
  25. most sections missing.
  26. .LP
  27. Mapfiles are created either by text editing,
  28. by \fIxconq\fP, or by a combination of both.  
  29. Since they are mostly read by variations on C's \fIscanf\fP function,
  30. the format is rather rigid; numbers may not be omitted, no blank lines
  31. are allowed (but whitespace between numbers on a line is OK),
  32. and mistakes will not always be recognized.
  33. The one general exception is the period description, which is read by
  34. a lexical analyzer, which allows free-format input.  Other more specific
  35. exceptions will be noted below.
  36. .SH
  37. MAPFILES
  38. .LP
  39. A mapfile is a normal ASCII text file.  It begins with a header line of the
  40. form
  41. .IP
  42. \fBXconq \fIn [+-][+-][+-][+-][+-][+-] description[;]\fR
  43. .LP
  44. where \fIn\fP
  45. is the number of additional mapfiles to be loaded (up to 16 or so in all),
  46. each + or -
  47. indicates the presence or absence of a particular section, and the
  48. \fIdescription\fP
  49. is free-form text (remainder of the line) describing the mapfile.
  50. Note that that all reading/writing in the mapfile is case-sensitive,
  51. including the header words.
  52. The sections are for version, period, map, globals, sides, and units,
  53. in that order.  Most sections vary in size, and some vary also in
  54. the detail of the information they contain.  Most include extension
  55. flags, which are reserved for future expansion of mapfiles.
  56. .LP
  57. Additional notes may be included by terminating the \fIdescription\fP
  58. with a semicolon (with NO whitespace following).
  59. In such a case, the following text lines
  60. will skipped over until a period "." is seen by itself on a line.
  61. .LP
  62. Following the header are the names of the \fIn\fP
  63. mapfiles, one to a line.
  64. Each will be loaded into \fIxconq\fP before the rest of the current mapfile.
  65. This process is recursive (at least in theory).  Any conflicts are
  66. resolved by simple overwriting.  Note that this presents the possibility
  67. of catastrophic conflicts if the designer is not careful to, say, match
  68. units and periods.  A file with a given name will be loaded only once;
  69. a second attempt will result in a warning message, and the program will
  70. continue on.
  71. .LP
  72. The version section is quite simple, since it is one line;
  73. exactly the version
  74. string displayed when \fIxconq\fP starts up.  This is typically only needed for
  75. saved games, but might be convenient while \fIxconq\fP versions are changing
  76. incompatibly.
  77. When this section is loaded, the version is merely compared with the
  78. internal version number, and \fIxconq\fP fails if they do not match.
  79. .LP
  80. The period section is a program in a simple postfix language,
  81. which when executed fills in the period description.
  82. .LP
  83. The map section includes the world dimensions and terrain.
  84. It may also include information about countries at some future date.
  85. .LP
  86. The globals section includes any global values, such as the current turn,
  87. and also the win/lose conditions for a scenario.
  88. .LP
  89. The sides section defines the sides in a game.  Required info is little
  90. more than the name of the side, but a detailed section may also include
  91. the area of the map seen by that side, and other data.
  92. .LP
  93. Finally, the units sections lists a number of units in the game.
  94. Again, detail can range from type, name, and position to complete
  95. details on its orders.
  96. .LP
  97. Each of these sections is entirely optional - \fIxconq\fP can synthesize its
  98. own replacements for each.  For instance, a mapfile could specify a map
  99. and two sides, or a period, or an entire game, by including the appropriate
  100. sections.
  101. The sections do interact somewhat, with dependencies as follows:
  102. .IP
  103. Maps, win/lose conditions in globals,
  104. detailed sides, and units depend on period.
  105. .IP
  106. Detailed and/or non-neutral units depend on sides.
  107. .LP
  108. The following sections discuss each part of a mapfile in more detail.
  109. The version secton
  110. has already been covered sufficiently.
  111. Since the period defines what may appear in all the other sections,
  112. I shall begin with it.
  113. .so period.ms
  114. .SH
  115. MAPS
  116. .LP
  117. Maps alone are the easiest thing to customize.  You can either do ordinary
  118. text editing to acquire the map data, then add the headers, or use the
  119. online terrain editing capability of \fIxconq\fP and save the terrain alone.
  120. .LP
  121. The map header has the form
  122. .IP
  123. \fBMap \fIwidth height scale seen extension\fR
  124. .LP
  125. where \fIwidth\fP and \fIheight\fP are the size of the map,
  126. while the \fIscale\fP is
  127. the width of a single hex in km (measured between parallel faces).
  128. The \fIseen\fP flag is \fB0\fP if the map is not known to the players,
  129. and \fB1\fP if it is (this is like using \fB"-v"\fP on the command line).
  130. The \fIextension\fP
  131. is an extension flag, with a value of \fB0\fP for the normal map.
  132. Other values are reserved for extensions.
  133. .LP
  134. The preferred way to build a map is to use the \fB"-B"\fP
  135. option of \fIxconq\fP.
  136. This enables the space bar to "paint" terrain onto the map.
  137. The "brush" is defined by using the terrain characters as commands
  138. (they will override any normal commands on the same letters).
  139. The argument is also useful - if positive, it is the radius of the
  140. area to be painted with the given terrain type, if negative,
  141. it is the length of a horizontal bar.  Thus, in the standard period,
  142. the sequence \fB"999. "\fP will convert all but the largest maps into open sea.
  143. To save the map by itself, answer with the string "m" when "saving the game"
  144. (described in more detail below).
  145. .LP
  146. The other way to build is by using a text editor and following the format
  147. exactly.
  148. The terrain data is a number of long lines of characters.  The length of
  149. the lines must be exactly the width of the map.  The characters for
  150. terrain types are defined by the period.
  151. The coordinate system is Cartesian oblique, with the y axis tilted to form
  152. a 60-degree angle with the x axis.  Thus, landforms in the mapfile should
  153. appear to be leaning to the left, if they are to appear upright during play.
  154. .LP
  155. Maps should have some distinguishing terrain
  156. on the northern and southern edges;  also, remember that the default
  157. map shape wraps around in the east-west direction, so landforms should
  158. match up.  If the wraparound is undesirable, a vertical stripe of
  159. some otherwise-unused type (such as outer space) is useful to block movement.
  160. .LP
  161. Run-length encoding is also available.  It is flagged by a numeric digit,
  162. followed by any number of digits, followed by a terrain character.  The
  163. terrain character will be replicated the number of times specified by the
  164. digit string.  The encoding may be freely intermixed with normal terrain,
  165. but cannot extend over line boundaries.
  166. .SH
  167. GLOBALS
  168. .LP
  169. Globals include a number of values affecting an entire game.  The header
  170. is in the following form:
  171. .IP
  172. \fBGlobals \fIgametime endtime setproduct leavemap numconds extension\fR
  173. .LP
  174. where \fIgametime\fP is the elapsed turns, \fIendtime\fP is the last turn
  175. of the game, \fIsetproduct\fP controls whether unit construction is changeable,
  176. \fIleavemap\fP allows units to leave by the map edges,
  177. and \fIextension\fP is reserved for extensions (is normally \fB0\fP).
  178. .LP
  179. \fInumconds\fP specifies the number of winning/losing conditions.
  180. Conditions are evaluated at the end of each turn (along with other
  181. ways to lose, such as losing all of one's units).
  182. A win condition results in the side achieving it winning
  183. while all others lose.
  184. A losing condition knocks the side out of the game, and the other sides
  185. continue normally.
  186. Multiple win and lose conditions
  187. act as disjunctions - when one is satisfied, something will happen.
  188. There is a limit of about 10 conditions or so.
  189. All conditions include a starting and ending time for
  190. when they are in effect, as well as the number of a side to which it
  191. applies, or \fB-1\fP it is to be applied to all sides equally.
  192. .LP
  193. The first line of a condition is the same for all types:
  194. .IP
  195. \fI win/lose type start end side(s)\fR
  196. .LP
  197. where \fIwin/lose\fP is \fB1\fP if the condition is for winning
  198. and \fB0\fP for losing,
  199. \fIstart\fP and \fIend\fP are the starting and ending turns for testing
  200. the condition, \fIside(s)\fP is the number of a side to which the condition
  201. applies (or \fB-1\fP if it applies to any side), 
  202. and \fItype\fP is the type of condition:
  203. .IP \fB0\fP
  204. Territory; next line is one number, the amount of territory
  205. (above if to win, below if to lose).
  206. .IP \fB1\fP
  207. Number of units; next line is list of numbers, one for each unit type.
  208. To win, must possess at least that many of each type.
  209. To lose, must be at or below that many for \fIall\fP unit types
  210. simultaneously
  211. (the default losing condition is this one, with all zeros).
  212. To make this condition apply to only one unit type, set all the other
  213. numbers to very low (for win condition) or very high (for lose condition)
  214. values, outside the range normally occurring during a game.
  215. .IP \fB2\fP
  216. Quantity of resources; next line is a list of numbers, one for each
  217. resource type.  Winning and losing is same as for unit types.
  218. .IP \fB3\fP
  219. Possession; next line is three numbers,
  220. the first two representing the coordinates of a hex, and the third
  221. the number of a unit type (or \fB-1\fP to indicate all unit types).
  222. To win, must have a unit of the specified type on the hex.
  223. To lose, do not have a unit on that hex.
  224. .LP
  225. Each condition has a sort of dual identity, since it is interpreted
  226. slightly differently, depending on whether it is flagged for winning
  227. or losing.  The logic is a little twisted perhaps - special conditions
  228. should have all cases tested carefully before a scenario is released.
  229. .SH
  230. SIDES
  231. .LP
  232. Sides need relatively little information stored about them, particularly
  233. for a scenario.  The header is simple:
  234. .IP
  235. \fBSides \fInumsides detail extension\fR
  236. .LP
  237. where
  238. .I numsides
  239. is the number of sides recorded, and
  240. .I detail
  241. is the level of detail that was recorded.
  242. .LP
  243. The side's name can be set using the naming or \fBC\fPall command, when
  244. the cursor is not over a unit, or if an argument is supplied (this will be
  245. the number of a side, and can be used in build mode to change the names
  246. of other sides).
  247. .LP
  248. The exact contents of each level of detail are as follows:
  249. .IP \fB1\fP
  250. Name of side only is saved.  This is sufficient for many scenarios.
  251. .IP \fB2\fP
  252. Name, attributes, and political status and production counts (used for
  253. numbering unnamed units) saved.
  254. .IP \fB3\fP
  255. All of above, plus view of explored part of world.
  256. .IP \fB4\fP
  257. All of above, plus hosts and player types, plus statistics if used.
  258. .IP \fB9\fP
  259. All possible data.  This is the level used for saved games.
  260. (At the moment, this is equivalent to level 4, but may include more data
  261. in the future.)
  262. .LP
  263. The data for each level begins on a new line, and some levels need several
  264. lines (such as the view data).  The best way to study the layout is to
  265. examine a saved game.
  266. .SH
  267. UNITS
  268. .LP
  269. Units have quite a few attributes, nearly all of which must be saved.
  270. The header is as simple as for sides:
  271. .IP
  272. \fBUnits \fInumunits detail extension\fR
  273. .LP
  274. where \fInumunits\fP is the number of units saved, \fIdetail\fP
  275. is the level of detail that was recorded, and of course \fIextension\fP
  276. is the usual extension with only a value of \fB0\fP.
  277. There are several levels of detail:
  278. .IP \fB1\fP
  279. Type, name, and position, and side.
  280. The re-created units will be fully supplied and awake.
  281. Neutral units have a side of -1.
  282. Units capable of construction will be idled, so there should be at
  283. least one movable unit present.
  284. .IP \fB2\fP
  285. All of above, plus scalar attributes and supply amounts, all on one line.
  286. (Look at a saved game or the source code to interpret the numbers.)
  287. .IP \fB3\fP
  288. All of above, plus orders and standing orders if defined.
  289. .IP \fB9\fP
  290. All possible data.  This is the level used for saved games.
  291. (Same as level 3 at present.)
  292. .LP
  293. Build mode offers a number of way to manipulate units on any side,
  294. as described in the next section.
  295. .SH
  296. SCENARIOS
  297. .LP
  298. The \fB-B\fP command line option starts up \fIxconq\fP in \fIbuild mode\fP,
  299. where many
  300. additional actions are possible, all oriented towards the editing of
  301. game state.  All commands can be performed on any side's units, and
  302. none of the machine players will move (this can be toggled by using the
  303. quit command 'Q', then saying 'n' to the confirmation question).  Build mode
  304. allows some other acts:
  305. .IP
  306. Move any unit anywhere instantly, using the moveto command 'm'.
  307. .IP
  308. Create any unit anywhere, using '\\' (prompts for unit type, argument
  309. specifies side, defaults to neutral).
  310. .IP
  311. Modify terrain anywhere, as described under the map section.
  312. .IP
  313. See all units everywhere, using 'V'
  314. .IP
  315. Do anything to any unit as if it were your own, using the usual commands.
  316. .LP
  317. Once all desired changes have been made, you may wish to allow machine
  318. players to move a little, just to randomize things a bit.  Then use the
  319. normal game save command.  In build mode, you will be asked to enter a
  320. string indicating sections and levels of detail.  The string should contain
  321. a character for each section you want written out - 'g' for globals, 'u'
  322. for units, and so forth.  The letters 'u' and 's' must each be followed by
  323. a digit indicating the level of detail desired, as described earlier.
  324. The default string is \fB"ms1u1"\fP, which will write a mapfile with the map,
  325. side names, and unit types/names/positions/sides, which is sufficient
  326. for many interesting scenarios.
  327. The file that will be written is always called \fB"random.scn"\fP,
  328. is written into the current directory, and should be renamed as desired.
  329. After sufficient playtesting, it may be added to the scenario menu, just
  330. by adding its name to the file \fB"mapfiles"\fP in the library directory.
  331. .LP
  332. Scenario construction is not for everybody.  Since the processes are
  333. semi-internal, the error-checking is not as extensive.  For instance,
  334. you can load a submarine with battleships as passengers.  There are
  335. also more subtle questions of balance, which are usually revealed by
  336. repeated play of the scenario.  As a rule, the lower levels of detail
  337. are safer to use - level 1 details for sides and units are often
  338. simple enough to be typed in or edited by hand.
  339. .SH
  340. EXAMPLES
  341. .LP
  342. A period description with only infantry and cities:
  343. .DS
  344. Xconq 0 -+---- Very simple test period
  345. Period 0
  346.  
  347. "generic" period-name
  348.  
  349. "standard" font
  350.  
  351. "i" "infantry" "moves around" utype
  352. "@" "city" "makes infantry units" utype
  353.  
  354. "+" "land" "green" ttype  ; must always have at least one terrain type
  355.  
  356. 1 @ in-country
  357. 100 land @ favored
  358.  
  359. @ first-unit
  360. i first-product
  361.  
  362. 1 i @ make
  363. true @ maker
  364. 1 i @ capacity  ; makers need to be able to hold or be held by products
  365.  
  366. 1 i speed
  367.  
  368. 0 t* i moves
  369.  
  370. begin{notes}
  371. This is just a test.
  372. Kids, don't try this at home!
  373. end{notes}
  374.  
  375. end
  376. .DE
  377. A tiny map with two cities, including an "empire" period description to ensure
  378. meaningful city definitions:
  379. .DS
  380. Xconq 1 --+--+ Tiny map;
  381. just an example...
  382. .
  383. empire.per
  384. Map 9 5 100 1 0
  385. :........
  386. :.+++++..
  387. :..+^^^..
  388. :...+~~..
  389. :........
  390. Units 2 1 0
  391. @ New Cork 2,3 -1
  392. @ Old York 4,1 -1
  393. .DE
  394. .SH
  395. LOSSAGES
  396. .LP
  397. Several words are marked NIY, meaning that although they can be used,
  398. the code does not actually take them into account.
  399.